﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using VeMayBayDTO;
namespace VeMayBayDAO
{
     public class SanBayTrungGianDAO
    {
         public static bool InsertSBTrungGian(SanBayTrungGianDTO sbtg)
         {
             string query = @"insert into SanBayTrungGian (masanbay,machuyenbay,thoigiandung)values
                                (" + sbtg.SanBay.MaSanBay + "," + sbtg.ChuyenBay.MaChuyenBay + "," + sbtg.ThoiGianDung + ")";
             int n = DataProvider.ExecNonQuery(query);
             if (n == 0)
                 return false;
             return true;
         }

         public static DataTable GetAllSanBayTG()
         {
             string query = "select * from sanbaytrunggian";
             DataTable dt = new DataTable();
             dt = DataProvider.ExecQuery(query);
             return dt;
         }
    }
}
